﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;

#if !WINRT
using System.Windows.Data;
#else
using Windows.UI.Xaml.Data;
#endif

namespace MishraReader.Converters
{
#if !WINRT
    [ValueConversion(typeof(int), typeof(OverlayFontSize))]
#endif
    public class UnreadCountToOverlayFontSizeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter,
#if !WINRT
            CultureInfo culture
#else
 string language
#endif
)
        {
            if (value is int)
            {
                var count = (int)value;

                if (count < 10)
                    return OverlayFontSize.Small;

                if (count < 100)
                    return OverlayFontSize.Medium;

                return OverlayFontSize.Large;
            }

            return OverlayFontSize.Small;
        }

        public object ConvertBack(object value, Type targetType, object parameter,
#if !WINRT
            CultureInfo culture
#else
 string language
#endif
)
        {
            throw new NotImplementedException();
        }
    }

    public enum OverlayFontSize
    {
        Small,
        Medium,
        Large
    }
}